package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.EngineerTrainingTimerService;
import edu.fudan.mylang.pf.BaseService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service("com.shrcl.engineerprocess.domain.impl.EngineerTrainingTimerServiceImpl")
public class EngineerTrainingTimerServiceImpl extends BaseService implements EngineerTrainingTimerService {
  @Scheduled(cron = "0 0 9 * * ?")
  public void firstNotifyTimer() {
    final com.shrcl.engineerprocess.domain.EngineerTrainingStatus __created = com.shrcl.engineerprocess.domain.EngineerTrainingStatus.created;
    edu.fudan.mylang.pf.IGenericQuery<com.shrcl.engineerprocess.domain.EngineerTraining> query=getObjectFactory().createGenericQuery(com.shrcl.engineerprocess.domain.EngineerTraining.class,"select e from com.shrcl.engineerprocess.domain.impl.EngineerTrainingImpl as e where  e.Status = :__created ").setParameter("__created",__created);
    java.util.Collection<com.shrcl.engineerprocess.domain.EngineerTraining> _list = query.list();
    final org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrcl.engineerprocess.domain.EngineerTraining> _function = new org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrcl.engineerprocess.domain.EngineerTraining>() {
    	public void apply(final com.shrcl.engineerprocess.domain.EngineerTraining it) {
    		it.firstNotifyTimer();
    	}
    };
    org.eclipse.xtext.xbase.lib.IterableExtensions.<com.shrcl.engineerprocess.domain.EngineerTraining>forEach(_list, _function);
    
    
  }
  
  @Scheduled(cron = "0 0 9 * * ?")
  public void secondNotifyTimer() {
    final com.shrcl.engineerprocess.domain.EngineerTrainingStatus __firstNotified = com.shrcl.engineerprocess.domain.EngineerTrainingStatus.firstNotified;
    edu.fudan.mylang.pf.IGenericQuery<com.shrcl.engineerprocess.domain.EngineerTraining> query=getObjectFactory().createGenericQuery(com.shrcl.engineerprocess.domain.EngineerTraining.class,"select e from com.shrcl.engineerprocess.domain.impl.EngineerTrainingImpl as e where  e.Status = :__firstNotified ").setParameter("__firstNotified",__firstNotified);
    java.util.Collection<com.shrcl.engineerprocess.domain.EngineerTraining> _list = query.list();
    final org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrcl.engineerprocess.domain.EngineerTraining> _function = new org.eclipse.xtext.xbase.lib.Procedures.Procedure1<com.shrcl.engineerprocess.domain.EngineerTraining>() {
    	public void apply(final com.shrcl.engineerprocess.domain.EngineerTraining it) {
    		it.secondNotifyTimer();
    	}
    };
    org.eclipse.xtext.xbase.lib.IterableExtensions.<com.shrcl.engineerprocess.domain.EngineerTraining>forEach(_list, _function);
    
    
  }
}
